{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$$ P(A \\mid B)=\\frac{P(B \\mid A)\\, P(A)}{P(B)} $$\n",
    "$$ \\frac{1}{3} $$\n",
    "$$ \\sum_{i=1}^n a_i=0 $$\n",
    "$$ f(x) = x^{x^x} $$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$$ X^TAA^TX $$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$$ x^2, x_1^2, x_{22}^{(n)}, ^{16}O_{32}^{2-} $$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$$ \\frac{x}{y}, x/y $$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$$ \\sqrt{2} $$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$$ \\int_{a}^{b}x \\, dx $$\n",
    "$$ \\int\\limits_a^b $$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$$ \\overline{x} $$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "  $ AX = B $ 的最优解为什么是 $ X=(A^TA)^{-1}A^TB $，梯度为什么是 $ (A^TA)X-(A^TB) $\n",
    "  \n",
    "  推导过程：\n",
    "  \n",
    "  目标函数：$ (AX-B)^T(AX-B) $\n",
    "  \n",
    "  目标函数展开：$ X^TA^TAX - B^TAX - X^TA^TB + B^TB $\n",
    "  \n",
    "  目标函数求导：$ 2A^TAX - A^TB - A^TB + O $ 即 $ 2A^TAX - 2A^TB $\n",
    "  \n",
    "  导数为零时有极值，所以：$ X=(A^TA)^{-1}A^TB $"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$ \\dfrac{d}{dX}AX $ 因为X是n\\*1维的，所以A应该是x\\*n维，因为分母布局求导后是n行的，所以结果应该是 $ A^T $\n",
    "\n",
    "$ \\dfrac{d}{dX}X^TA $ 因为X是n\\*1维的，所以A应该是n\\*x维，因为分母布局求导后是n行的，所以结果应该是 $ A $"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$$ \\frac{d}{dX}f^T(x)g(x) = f^{'}(x)g(x) + g{'}(x)f(x) $$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "  $ \\dfrac{d}{dX}X^TA^TAX $\n",
    "  \n",
    "  $ f^T(x)=X^TA^T $ ， $ g(x)=AX $\n",
    "  \n",
    "  $ f(x)=AX $ ， $ f^{'}(x)=A^T $\n",
    "  \n",
    "  $ g(x)=AX $ ， $ g^{'}(x)=A^T $\n",
    "  \n",
    "  因此：$ \\dfrac{d}{dX}X^TA^TAX $ = $ A^TAX $ + $ A^TAX $ = $ 2A^TAX $"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " $"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
